如何在网页里添加分页[1] [2] [3] [4] 。。。分页插入的代码是什么?

来源:百度知道 编辑:UC知道 时间:2024/05/13 19:46:41

.net的自己的控件就可以了,不用自己写

asp的话要自己写:
<%
MMaxPerPage=16
rs.PageSize=MMaxPerPage

if trim(request("Page"))<>"" then
CurrentPage=CInt(request("Page"))
if CurrentPage>rs.PageCount then
CurrentPage=rs.PageCount
end if
else
CurrentPage=1
end if

'if rs.EOF then
' Response.Write "<p align='center'>ERROR!<BR>No record found!</p>"
'else
ttotalPut=rs.RecordCount
if CurrentPage<>1 then
if (CurrentPage-1)*MMaxPerPage<ttotalPut then
rs.Move(CurrentPage-1)*MMaxPerPage
bookmark=rs.Bookmark
end if
end if
'end if

if (ttotalPut mod MMaxPerPage)=0 then
mm=ttotalPut\MMaxPerPage
else
mm=ttotalPut\MMaxPerPage+1
end if

if (ttotal